import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/home/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/product/:id',
      name: 'product',
      component: () => import('../views/product/index.vue'),
    },
    {
      path: '/order/confirm',
      name: 'orderConfirm',
      component: () => import('../views/order/confirm.vue'),
    },
    // Policy Pages
    {
      path: '/policies/terms-of-use',
      name: 'termsOfUse',
      component: () => import('../views/policies/TermsOfUse.vue'),
    },
    {
      path: '/policies/refund-policy',
      name: 'refundPolicy',
      component: () => import('../views/policies/RefundPolicy.vue'),
    },
    {
      path: '/policies/shipping-policy',
      name: 'shippingPolicy',
      component: () => import('../views/policies/ShippingPolicy.vue'),
    },
    {
      path: '/policies/privacy-policy',
      name: 'privacyPolicy',
      component: () => import('../views/policies/PrivacyPolicy.vue'),
    },
    {
      path: '/policies/cookie-policy',
      name: 'cookiePolicy',
      component: () => import('../views/policies/CookiePolicy.vue'),
    },
    {
      path: '/policies/ssl-info',
      name: 'sslInfo',
      component: () => import('../views/policies/SSLInfo.vue'),
    },
    {
      path: '/policies/export-restrictions',
      name: 'exportRestrictions',
      component: () => import('../views/policies/ExportRestrictions.vue'),
    },
    {
      path: '/policies/shipping-countries',
      name: 'shippingCountries',
      component: () => import('../views/policies/ShippingCountries.vue'),
    },
    {
      path: '/policies/international-orders',
      name: 'internationalOrders',
      component: () => import('../views/policies/InternationalOrders.vue'),
    },
  ],
  scrollBehavior() {
    return { top: 0 }
  }
})

export default router
